{include file="public/header" /}
<script src="/static/ueditor/ueditor.config.js"></script>
<script src="/static/ueditor/ueditor.all.min.js"></script>
<script src="/static/ueditor/lang/zh-cn/zh-cn.js"></script>
<style>


</style>
<body>
<div class="x-body ">
    <form  class="layui-form">
        <div class="layui-form-item">
            <label for="process_id" class="layui-form-label">工艺编号</label>
            <div class="layui-input-inline">
                <input type="text" id="process_id1" disabled="disabled" name="" lay-verify="required" autocomplete="off" class="layui-input" value="<?php echo substr($drawing_detail_id,strpos($drawing_detail_id,'P')+1); ?>" >
                <input type="hidden" id="process_id" disabled="disabled" name="process_id" lay-verify="required" autocomplete="off" class="layui-input" value="{$drawing_detail_id}" >
                <p id="pLog" style="color:red"></p>
            </div>
        </div>
        <div class="layui-form-item" >
            <label class="layui-form-label">工艺类型</label>
            <div class="layui-input-block">
                <select name="process_type" lay-verify="required" lay-search="">
                    <option value=""></option>
                    {volist name="processType" id ="processTypeInfo" }
                    <option value="{$processTypeInfo.id}">{$processTypeInfo.process_name}</option>
                    {/volist}
                </select>
            </div>
        </div>
        {if  $Think.session.user.is_quota == 1}
        <div class="layui-form-item">
            <label for="process_quota" class="layui-form-label">工序定额h(小时)</label>
            <div class="layui-input-inline">
                <input type="text" id="process_quota" name="process_quota"  autocomplete="off" class="layui-input"  >
            </div>
        </div>
        {else}
        <div class="layui-form-item">
            <label for="process_quota" class="layui-form-label">工序定额h(小时)</label>
            <div class="layui-input-inline">
                <input type="text" id="process_quota" value="0" disabled name="process_quota"  autocomplete="off" class="layui-input"  >
            </div>
        </div>
        {/if}
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">工艺说明</label>
            <div class="layui-input-block">
                <textarea name="process_content"  id="content" ></textarea>
            </div>
        </div>
        <script type="text/javascript">
            //实例化编辑器
            //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
            UE.getEditor('content',{initialFrameWidth:300,initialFrameHeight:200,elementPathEnabled:false,wordCount:false,zIndex :0, toolbars:[['bold','superscript','subscript','fontsize','spechars']]});
        </script>

        <div class="layui-form-item">
            <label class="layui-form-label">是否检验</label>
            <div class="layui-input-block">
                <input type="checkbox"  name="if_check" lay-skin="switch" lay-filter="switchTest" lay-text="是|否">
                <div class="layui-unselect layui-form-switch layui-form-onswitch" lay-skin="_switch"><em>ON</em><i></i></div>
            </div>
        </div>
        <!--设置价格权限-->
        {switch name="$Think.session.user.is_offer"}
        {case value="0"}

        {/case}
        {case value="1"}
        <div class="layui-form-item">
            <label class="layui-form-label">报价定额h(小时)</label>
            <div class="layui-input-inline">
                <input type="text"  disabled  autocomplete="off" value="0" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">工序报价</label>
            <div class="layui-input-inline">
                <input type="text" disabled   placeholder="￥"  autocomplete="off" value="0" class="layui-input">
            </div>
        </div>
        {/case}
        {default /}
        <div class="layui-form-item">
            <label class="layui-form-label">报价定额h(小时)</label>
            <div class="layui-input-inline">
                <input type="text" id="quota_quotation" name="quota_quotation" autocomplete="off" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">工序报价</label>
            <div class="layui-input-inline">
                <input type="text" id="process_quoted_price" name="process_quoted_price"  placeholder="￥"  autocomplete="off" class="layui-input">
            </div>
        </div>
        {/switch}
        <div class="layui-form-item">
            <label class="layui-form-label">外协费用</label>
            <div class="layui-input-inline">
                <input type="text" id="process_real_price" placeholder="￥"  name="process_real_price" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-inline">
                <input type="text" id="remark" name="remark" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">明细编号</label>
            <div class="layui-input-inline">
                <input type="text" id="drawing_detial_id" name="drawing_detial_id" lay-verify="required" autocomplete="off" class="layui-input" value="{$drawing_detail_ids}" disabled="disabled">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <button class="layui-btn" lay-submit lay-filter="addId">
                增加
            </button>
        </div>
    </form>
</div>
<script>
    layui.use(['form'], function(){
        $ = layui.jquery;
        var form = layui.form,layer = layui.layer;

        //监听提交
        form.on('submit(addId)', function(data){
            //console.log(data);
            $.post("{:url('index/Blueprint/addProcess')}",data.field,function(info){
                if (info) {
                    layer.alert("添加成功", {icon: 6},function () {
                        window.parent.location.reload();  //刷新父级页面
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前弹出层
                        parent.layer.close(index);
                    });
                }else{
                    layer.alert("添加失败", {icon: 5});
                }
            },'json');
            return false;
        });


    });
</script>
<script>var _hmt = _hmt || []; (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>
</body>

</html>